package com.pai4j.pgc.dao;

import com.pai4j.pgc.entity.CreatorAuditRecordEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 创作者审核记录DAO接口
 *
 * @author: CYM-pai
 * @date: 2025/11/01
 */
@Repository
public interface ICreatorAuditRecordDAO extends JpaRepository<CreatorAuditRecordEntity, Long>, JpaSpecificationExecutor<CreatorAuditRecordEntity> {
    
    /**
     * 根据创作者ID查询审核记录
     */
    List<CreatorAuditRecordEntity> findByCreatorIdOrderByCreateDateDesc(Long creatorId);
    
    /**
     * 根据用户ID查询审核记录
     */
    List<CreatorAuditRecordEntity> findByUserIdOrderByCreateDateDesc(String userId);
    
    /**
     * 根据审核状态分页查询
     */
    Page<CreatorAuditRecordEntity> findByAuditStatus(Integer auditStatus, Pageable pageable);
    
    /**
     * 根据审核类型和状态查询
     */
    Page<CreatorAuditRecordEntity> findByAuditTypeAndAuditStatus(Integer auditType, Integer auditStatus, Pageable pageable);
}

